using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._AnalysisTools._Overlay
{
    /// <summary>
    /// <para>Identity</para>
    /// <para>Computes a geometric intersection of the input features and identity features. The input features or portions thereof that overlap identity features will get the attributes of those identity features.</para>
    /// <para>计算输入要素和标识要素的几何交集。与标识要素重叠的输入要素或其部分将获得这些标识要素的属性。</para>
    /// </summary>    
    [DisplayName("Identity")]
    public class Identity : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public Identity()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The input feature class or layer.</para>
        /// <para>输入要素类或图层。</para>
        /// </param>
        /// <param name="_identity_features">
        /// <para>Identity Features</para>
        /// <para>The identity feature class or layer. Must be polygons or the same geometry type as the input features.</para>
        /// <para>标识要素类或图层。必须是面或与输入要素相同的几何类型。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The feature class that will be created and to which the results will be written.</para>
        /// <para>将要创建并将结果写入其中的要素类。</para>
        /// </param>
        public Identity(object _in_features, object _identity_features, object _out_feature_class)
        {
            this._in_features = _in_features;
            this._identity_features = _identity_features;
            this._out_feature_class = _out_feature_class;
        }
        public override string ToolboxName => "Analysis Tools";

        public override string ToolName => "Identity";

        public override string CallName => "analysis.Identity";

        public override List<string> AcceptEnvironments => ["MDomain", "MResolution", "MTolerance", "XYDomain", "XYResolution", "XYTolerance", "ZDomain", "ZResolution", "ZTolerance", "autoCommit", "configKeyword", "extent", "outputCoordinateSystem", "outputMFlag", "outputZFlag", "outputZValue", "parallelProcessingFactor", "qualifiedFieldNames"];

        public override object[] ParameterInfo => [_in_features, _identity_features, _out_feature_class, _join_attributes.GetGPValue(), _cluster_tolerance, _relationship.GetGPValue()];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The input feature class or layer.</para>
        /// <para>输入要素类或图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Identity Features</para>
        /// <para>The identity feature class or layer. Must be polygons or the same geometry type as the input features.</para>
        /// <para>标识要素类或图层。必须是面或与输入要素相同的几何类型。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Identity Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _identity_features { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The feature class that will be created and to which the results will be written.</para>
        /// <para>将要创建并将结果写入其中的要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Attributes To Join</para>
        /// <para><xdoc>
        ///   <para>Determines what attributes will be transferred to the output feature class.</para>
        ///   <bulletList>
        ///     <bullet_item>All attributes—All the attributes (including FIDs) from the input features, as well as the identity features, will be transferred to the output features. If no intersection is found the identity feature values will not be transferred to the output (their values will be set to empty strings or 0) and the identity feature FID will be -1. This is the default.</bullet_item><para/>
        ///     <bullet_item>All attributes except feature IDs—All the attributes except the FID from the input features and identity features will be transferred to the output features. If no intersection is found the identity feature values will not be transferred to the output (their values will be set to empty strings or 0).</bullet_item><para/>
        ///     <bullet_item>Only feature IDs—All the attributes from the input features but only the FID from the identity features will be transferred to the output features. The identity features FID attribute value in the output will be -1 if no intersection is found.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>确定将哪些属性传输到输出要素类。</para>
        ///   <bulletList>
        ///     <bullet_item>所有属性—输入要素中的所有属性（包括 FID）以及身份要素都将传输到输出要素。如果未找到交集，则标识要素值不会传输到输出（其值将设置为空字符串或 0），标识要素 FID 将为 -1。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>除要素 ID 之外的所有属性—输入要素和标识要素中除 FID 之外的所有属性都将传输到输出要素。如果未找到交集，则标识要素值将不会传输到输出（其值将设置为空字符串或 0）。</bullet_item><para/>
        ///     <bullet_item>仅要素 ID - 输入要素中的所有属性（仅标识要素的 FID）将传输到输出要素。如果未找到交集，则输出中的标识要素 FID 属性值将为 -1。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Attributes To Join")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _join_attributes_value _join_attributes { get; set; } = _join_attributes_value._ALL;

        public enum _join_attributes_value
        {
            /// <summary>
            /// <para>All attributes except feature IDs</para>
            /// <para>All attributes except feature IDs—All the attributes except the FID from the input features and identity features will be transferred to the output features. If no intersection is found the identity feature values will not be transferred to the output (their values will be set to empty strings or 0).</para>
            /// <para>除要素 ID 之外的所有属性—输入要素和标识要素中除 FID 之外的所有属性都将传输到输出要素。如果未找到交集，则标识要素值将不会传输到输出（其值将设置为空字符串或 0）。</para>
            /// </summary>
            [Description("All attributes except feature IDs")]
            [GPEnumValue("NO_FID")]
            _NO_FID,

            /// <summary>
            /// <para>Only feature IDs</para>
            /// <para>Only feature IDs—All the attributes from the input features but only the FID from the identity features will be transferred to the output features. The identity features FID attribute value in the output will be -1 if no intersection is found.</para>
            /// <para>仅要素 ID - 输入要素中的所有属性（仅标识要素的 FID）将传输到输出要素。如果未找到交集，则输出中的标识要素 FID 属性值将为 -1。</para>
            /// </summary>
            [Description("Only feature IDs")]
            [GPEnumValue("ONLY_FID")]
            _ONLY_FID,

            /// <summary>
            /// <para>All attributes</para>
            /// <para>All attributes—All the attributes (including FIDs) from the input features, as well as the identity features, will be transferred to the output features. If no intersection is found the identity feature values will not be transferred to the output (their values will be set to empty strings or 0) and the identity feature FID will be -1. This is the default.</para>
            /// <para>所有属性—输入要素中的所有属性（包括 FID）以及身份要素都将传输到输出要素。如果未找到交集，则标识要素值不会传输到输出（其值将设置为空字符串或 0），标识要素 FID 将为 -1。这是默认设置。</para>
            /// </summary>
            [Description("All attributes")]
            [GPEnumValue("ALL")]
            _ALL,

        }

        /// <summary>
        /// <para>XY Tolerance</para>
        /// <para><xdoc>
        ///   <para>The minimum distance separating all feature coordinates (nodes and vertices) as well as the distance a coordinate can move in X or Y (or both).</para>
        ///   <para>Changing this parameter's value may cause failure or unexpected results. It is recommended that this parameter not be modified. It has been removed from view in the tool dialog. By default, the input feature class's spatial reference x,y tolerance property is used.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>分隔所有要素坐标（节点和折点）的最小距离，以及坐标可以在 X 或 Y（或两者）中移动的距离。</para>
        ///   <para>更改此参数的值可能会导致失败或意外结果。建议不要修改该参数。它已从工具对话框的视图中删除。默认情况下，将使用输入要素类的空间参考 x，y 容差属性。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("XY Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _cluster_tolerance { get; set; } = null;


        /// <summary>
        /// <para>Keep relationships</para>
        /// <para><xdoc>
        ///   <para>Choose if you want additional spatial relationships between the Input Features and Identity Features to be written to the output. This only applies when the Input Features are lines and the Identity Features are polygons.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—No additional spatial relationship will be determined.</bullet_item><para/>
        ///     <bullet_item>Checked—The output line features will contain two additional fields, LEFT_poly and RIGHT_poly. These fields contain the feature ID of the Identity Features on the left and right side of the line feature.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>选择是否要将输入要素和标识要素之间的其他空间关系写入输出。仅当输入要素为直线且标识要素为面时，这才适用。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 将不确定其他空间关系。</bullet_item><para/>
        ///     <bullet_item>选中 - 输出线要素将包含两个附加字段：LEFT_poly 和 RIGHT_poly。这些字段包含线要素左侧和右侧标识要素的要素 ID。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Keep relationships")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _relationship_value _relationship { get; set; } = _relationship_value._false;

        public enum _relationship_value
        {
            /// <summary>
            /// <para>KEEP_RELATIONSHIPS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("KEEP_RELATIONSHIPS")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_RELATIONSHIPS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_RELATIONSHIPS")]
            [GPEnumValue("false")]
            _false,

        }

        public Identity SetEnv(object MDomain = null, object MResolution = null, object MTolerance = null, object XYDomain = null, object XYResolution = null, object XYTolerance = null, object ZDomain = null, object ZResolution = null, object ZTolerance = null, int? autoCommit = null, object configKeyword = null, object extent = null, object outputCoordinateSystem = null, object outputMFlag = null, object outputZFlag = null, object outputZValue = null, object parallelProcessingFactor = null, bool? qualifiedFieldNames = null)
        {
            base.SetEnv(MDomain: MDomain, MResolution: MResolution, MTolerance: MTolerance, XYDomain: XYDomain, XYResolution: XYResolution, XYTolerance: XYTolerance, ZDomain: ZDomain, ZResolution: ZResolution, ZTolerance: ZTolerance, autoCommit: autoCommit, configKeyword: configKeyword, extent: extent, outputCoordinateSystem: outputCoordinateSystem, outputMFlag: outputMFlag, outputZFlag: outputZFlag, outputZValue: outputZValue, parallelProcessingFactor: parallelProcessingFactor, qualifiedFieldNames: qualifiedFieldNames);
            return this;
        }

    }

}